package com.imooc.api.controller.user;

import com.imooc.grance.result.GraceJsonResult;
import com.imooc.pojo.bo.RegisterLoginBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created with IntelliJ IDEA.
 *
 * @auther Levi
 * @Date: 2021/03/13/16:57
 * @Description:
 */
@Api(value = "PassPortController",tags = "短信验证码测试接口")
@RequestMapping("/passport")
public interface PassPortControllerApi {


    @ApiOperation(value = "短信验证码测试接口",notes = "短信验证码测试接口",httpMethod = "GET")
    @GetMapping("/getSMSCode")
    public GraceJsonResult getSMSCode(String mobile, HttpServletRequest request);



    @ApiOperation(value = "用户登录注册接口",notes = "用户登录注册接口",httpMethod = "POST")
    @PostMapping("/doLogin")
    public GraceJsonResult doLogin(RegisterLoginBO registerLoginBO,
                                   HttpServletRequest request,
                                   HttpServletResponse response);

    /**
     * 用户退出登录
     * 清空redis中的token
     * 清空cookie中的utoken，uid
     *
     * @param userId
     * @param request
     * @param response
     * @return
     */
    @ApiOperation(value = "用户退出登录", notes = "用户退出登录", httpMethod = "POST")
    @PostMapping("/logout")
    public GraceJsonResult logout(@RequestParam String userId, HttpServletRequest request,
                                  HttpServletResponse response);
}
